package by.gravity.billprinter.data;

import by.gravity.billprinter.R;

public class SettingsManager extends PreferenceHelper {

	private static final String DEFAULT_URL = "95.215.46.68";

	public static final String SERVER_PATH = "kassa/ws/fr";

	public static String getLogin() {

		return getString(R.string.login, R.string.empty);
	}

	public static void setLogin(String login) {

		putString(R.string.login, login);
	}

	public static String getPassword() {

		return getString(R.string.password, R.string.empty);
	}

	public static void setPassword(String password) {

		putString(R.string.password, password);
	}

	public static String getText1Default() {

		return getString(R.string.text1Default, R.string.empty);
	}

	public static void setText1Default(String text) {

		putString(R.string.text1Default, text);
	}

	public static String getText2Default() {

		return getString(R.string.text2Default, R.string.empty);
	}

	public static void setText2Default(String text) {

		putString(R.string.text2Default, text);
	}

	public static void setServerName(String name) {

		putString(R.string.nameServer, name);
	}

	public static String getServerName() {

		return getString(R.string.nameServer, DEFAULT_URL);
	}

	public static void setPort(String port) {

		putString(R.string.port, port);
	}

	public static String getPort() {

		return getString(R.string.port, "443");
	}

	public static String getPathToCertificate() {

		return getString(R.string.pathToCertificate, R.string.empty);
	}

	public static void setPathToCertificate(String path) {

		putString(R.string.pathToCertificate, path);
	}

	public static String getCertificatePassword() {

		return getString(R.string.certificatePassword, R.string.empty);
	}

	public static void setCertificatePassword(String password) {

		putString(R.string.certificatePassword, password);
	}

	public static String getUrl() {

		return "https://" + getServerName() + "/" + SERVER_PATH;
	}

}
